package com.example.feignserver.service;

import com.example.feignserver.hystrix.EurekaClientHystrixService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * eureka-client 是调用的服务名
 * @author zhanghaidong
 * @version v1.0
 * @description
 * @date 2019/5/24
 */
@FeignClient(value = "eureka-client", fallback = EurekaClientHystrixService.class)
public interface EurekaClientService {

    /**
     * hello
     * @param name
     * @return
     */
    @GetMapping("/hello")
    String hello(@RequestParam(value = "name") String name);

    @GetMapping("/hello2")
    String hello2(@RequestHeader(value = "name") String name);
}
